/*
 * XMLLogger.cpp
 *
 *  Created on: Jun 14, 2013
 *      Author: dan
 */

#include "XMLLogger.hpp"
using namespace std;

namespace logger{
set<Logger::LOGTAG> Logger::avaliables_tags;
const Logger::LOGTAG Logger::LOGTAG_ALL="ALL";
struct init_avaliables_tags_t{init_avaliables_tags_t(){
	Logger::avaliables_tags.insert(Logger::LOGTAG_ALL);
}};
init_avaliables_tags_t init_avaliables_tags;


void object::open(Logger& logger)const{
	logger.tab()<<"<"<<name<<" "<<attributes.str()<<">";
	logger.incTab();
}
void object::close(Logger& logger)const{
	logger.decTab();
	logger.tab()<<"</"<<name<<">";
	logger.newLine();
}
void tag::open(Logger& logger)const{
	logger.tab()<<"<"<<name<<" "<<attributes.str()<<" />";
	logger.newLine();
}
void notype::open(Logger& logger)const{
	logger.cntn()<<data.str();
}
void type::open(Logger& logger)const{
	logger.cntn()<<data.str();
}

void close(Logger& l){ l.close(); }
void nline(Logger& l){ l.newLine(); }

}


